﻿using System;
using System.Diagnostics;
using System.IO;
using System.Security.Cryptography;
using System.Windows.Forms;
using EncryptionLib;
using EncryptionLib.Encryption;
using EncryptionLib.Signature;
using EncryptionLib.Users;

namespace TotalCommander_v3
{
    public partial class frmOption : Form
    {
        public SymmetricAlgorithms SymmetricAlgorithms
        {
            get
            {
                return (SymmetricAlgorithms)cmbEncryptAlgorithm.SelectedItem;
            }
        }
        public CipherMode CipherMode
        {
            get
            {
                return (CipherMode)cmbEncryptAlgorithm.SelectedItem;
            }
        }
        public PaddingMode PaddingMode
        {
            get
            {
                return (PaddingMode)cmbEncryptAlgorithm.SelectedItem;
            }
        }
        public bool Zip
        {
            get{
                return chkEncryptZip.Checked;
            }
        }
        public frmOption()
        {
            InitializeComponent();

            cmbEncryptAlgorithm.Items.Add(SymmetricAlgorithms.DES);
            cmbEncryptAlgorithm.Items.Add(SymmetricAlgorithms.RC2);
            cmbEncryptAlgorithm.Items.Add(SymmetricAlgorithms.Rijndael);
            cmbEncryptAlgorithm.Items.Add(SymmetricAlgorithms.TripleDES);
            cmbEncryptAlgorithm.SelectedIndex = 0;

            cmbEncryptCipherMode.Items.Add(CipherMode.ECB);
            cmbEncryptCipherMode.Items.Add(CipherMode.CBC);
            cmbEncryptCipherMode.Items.Add(CipherMode.CFB);
            cmbEncryptCipherMode.Items.Add(CipherMode.CTS);
            cmbEncryptCipherMode.Items.Add(CipherMode.OFB);
            cmbEncryptCipherMode.SelectedIndex = 0;

            cmbEncryptPaddingMode.Items.Add(PaddingMode.ANSIX923);
            cmbEncryptPaddingMode.Items.Add(PaddingMode.ISO10126);
            cmbEncryptPaddingMode.Items.Add(PaddingMode.None);
            cmbEncryptPaddingMode.Items.Add(PaddingMode.PKCS7);
            cmbEncryptPaddingMode.Items.Add(PaddingMode.Zeros);
            cmbEncryptPaddingMode.SelectedIndex = 0;
        }

        private void Config_Load(object sender, EventArgs e)
        {

        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            Close();
        }

        private void grpEncrypt_Enter(object sender, EventArgs e)
        {

        }
    }
}
